#include <bits/stdc++.h>
#include <bits/extc++.h>
using namespace std;

using llt = long long;
using vi = vector<int>;
using vll = vector<llt>;
using pii = pair<int, int>;
using pll = pair<llt, llt>;

/// 给定无向带权图，给定点集，求连接点集的最小子图
/// 设N为点数，M为边数，K为点集规模，O(N*3^K + MlogM * 2^K)
/// K不大
struct SteinerTree {

using  weight_t = llt;

struct _t{
    int from;
    int to;
    weight_t w; 
};

int N;
vector<vector<_t>> G;

void init(int n){
    G.assign((N = n) + 1, {});
}

void mkDiEdge(int a, int b, weight_t w){
    G[a].push_back({a, b, w});
}

void mkBiEdge(int a, int b, weight_t w){
    mkDiEdge(a, b, w); mkDiEdge(b, a, w);
}

int K;
vector<int> Candi;
/// Dstatus,i 表示以i为根包含status的最小权值树
vector<vector<weight_t>> D;


void run(vector<int> & dianji) {
    Candi.swap(dianji);
    K = Candi.size();

    D.assign(1 << K, vector<weight_t>(N + 1, inf()));
    for(int i=0;i<K;++i){
        D[1 << i][Candi[i]] = 0;
    }

    for(int status=1;status<(1<<K);++status){
        for(int t=status&status-1;t;t=t-1&status){
            if(t < (status ^ t)) break;
            for(int i=1;i<=N;++i){
                chkmin(D[status][i], chkadd(D[t][i], D[t ^ status][i]));
            }
        }
        shortest(status);
    }

    return;
}

void shortest(int status){
    queue<int> q;
    vector<int> flag(N + 1, 0);
    auto & d = D[status];
    for(int i=1;i<=N;++i) if(d[i] != inf()) q.push(i), flag[i] = 1;
    while(not q.empty()){
        int u = q.front(); q.pop();
        flag[u] = 0;
        for(const auto & e : G[u]){
            if(d[u] + e.w < d[e.to]){
                d[e.to] = d[u] + e.w;
                if(not flag[e.to]) q.push(e.to), flag[e.to] = 1;
            }
        }
    }
    return;
}

static void chkmin(weight_t & a, weight_t b){
    if(a > b) a = b;
}

weight_t chkadd(weight_t a, weight_t b){
    if(a == inf() or b == inf()) return inf();
    return a + b;
}

static weight_t inf() {
    static const weight_t INF = 0x7F8F9FAFBFCFDFEF;
    return INF;
}

};

int N, M, K;
SteinerTree St;

void work(){
    cin >> N >> M >> K;
    St.init(N);
    for(int a,b,w,i=0;i<M;++i){
        cin >> a >> b >> w;
        St.mkBiEdge(a, b, w);
    }
    vector<int> vec(K);
    for(auto & i : vec) cin >> i;
    St.run(vec);
    auto ans = St.D[(1 << K) - 1][St.Candi[0]];
    cout << ans << endl;
    return;
}


int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);	
    
    int nofkase = 1;
	// cin >> nofkase;
	while(nofkase--) work();
	return 0;
}